package cn.wxq.daily.empdailymgforserve.service.impl;

import cn.wxq.daily.empdailymgforserve.domain.WorkReport;
import cn.wxq.daily.empdailymgforserve.mapper.WorkReportDao;
import cn.wxq.daily.empdailymgforserve.service.WorkReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class WorkReportServiceImpl implements WorkReportService {

    @Autowired
    private WorkReportDao workReportDao;

    /**
     * 条件查询
     * @param workReport
     * @return
     */
    @Override
    public List<WorkReport> findAllReport(WorkReport workReport) {
        return workReportDao.findBpageReport(workReport);
    }

    /**
     * 新增
     * @param workReport
     * @return
     */
    @Override
    public int insertReport(WorkReport workReport) {
        workReport.setReportTime(new Date());
        return workReportDao.insertReport(workReport);
    }

    /**
     * 修改
     * @param workReport
     * @return
     */
    @Override
    public int updateReport(WorkReport workReport) {
        return workReportDao.updateReport(workReport);
    }

    /**
     * 删除
     * @param workId
     * @return
     */
    @Override
    public int deleteReportById(Integer workId) {
        return workReportDao.deleteReportById(workId);
    }
}
